﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLBV_Nhom8
{
    public partial class Main : Form
    {
        public Main()
        {
            InitializeComponent();
        }

        private void thoátToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        public void LogOff()
        {
            m_tiepnhan_StripMenuItem2.Enabled = false;
            m_hethong_ToolStripMenuItem.Enabled = false;
        }

        public void LoginAdmin()
        {

        }

        public void LoginChuyenKhoa()
        {
            m_hethong_ToolStripMenuItem.Enabled = false;
            m_tiepnhan_StripMenuItem2.Enabled = false;
            m_thungan_ToolStripMenuItem2.Enabled = false;
            m_khamchuyenkhoa_ToolStripMenuItem3.Enabled = true;
        }

        public void LoginNhanVien()
        {

        }

        public void LoginThuNgan()
        {
            m_hethong_ToolStripMenuItem.Enabled = false;
            m_tiepnhan_StripMenuItem2.Enabled = false;
            m_thungan_ToolStripMenuItem2.Enabled = true;
            m_khamchuyenkhoa_ToolStripMenuItem3.Enabled = false;
        }

        public void LoginTiepNhan()
        {
            m_hethong_ToolStripMenuItem.Enabled = false;
            m_tiepnhan_StripMenuItem2.Enabled = true;
            m_thungan_ToolStripMenuItem2.Enabled = false;
            m_khamchuyenkhoa_ToolStripMenuItem3.Enabled = false;
        }


        private void Main_Load(object sender, EventArgs e)
        {
            //LogOff();

            switch (frmDangNhap.BoPhan)
            {
                case "Admin":
                    LoginAdmin();
                    break;
                case "Khám Chuyên Khoa":
                    LoginChuyenKhoa();
                    break;
                case "Nhân Viên":
                    LoginNhanVien();
                    break;
                case "Thu Ngân":
                    LoginThuNgan();
                    break;
                case "Tiếp Nhận":
                    LoginTiepNhan();
                    break;
                default:
                    m_hethong_ToolStripMenuItem.Enabled = false;
                    m_tiepnhan_StripMenuItem2.Enabled = true;
                    m_thungan_ToolStripMenuItem2.Enabled = false;
                    m_khamchuyenkhoa_ToolStripMenuItem3.Enabled = false;
                    break;
            }




            label1.Text = string.Format("Xin chào, {0}", frmDangNhap.UserName);
            label1.Location = new Point(this.Width - 200, 7);
        }

        private void đăngXuấtToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LogOff();
        }

        private void m_dkkb_StripMenuItem_Click(object sender, EventArgs e)
        {
            frmDangKyKhamBenh obj = new frmDangKyKhamBenh();
            obj.MdiParent = this;
            obj.Show();
        }

        private void m_lhsbn_StripMenuItem_Click(object sender, EventArgs e)
        {
            frmHoSoBenhNhan obj = new frmHoSoBenhNhan();
            obj.MdiParent = this;
            obj.Show();
        }

        private void m_tcbn_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmTraCuuBenhNhan obj = new frmTraCuuBenhNhan();
            obj.MdiParent = this;
            obj.Show();
        }

        private void thanhToánTiềnKhámToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmThanhToanMacDinh obj = new frmThanhToanMacDinh();
            obj.MdiParent = this;
            obj.Show();
        }

        private void thanhToánToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmHoaDonThanhToanDichVu obj = new frmHoaDonThanhToanDichVu();
            obj.MdiParent = this;
            obj.Show();
        }

        private void thanhToánKhámBệnhToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmThanhToanKhamBenh obj = new frmThanhToanKhamBenh();
            obj.MdiParent = this;
            obj.Show();
        }

        private void traCứuĐạiLýToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmPhieuKhamBenh obj = new frmPhieuKhamBenh();
            obj.MdiParent = this;
            obj.Show();
        }

        private void m_qlnd_ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmQuanLyNguoiDung obj = new frmQuanLyNguoiDung();
            obj.MdiParent = this;
            obj.Show();
        }
    }
}